import request from '@/utils/request'

// 架层列表
export function caseList(data) {
  return request({
    url: '/virlib-admin/case/query',
    method: 'post',
    data
  })
}

// 增加架层
export function addCase(data) {
  return request({
    url: '/virlib-admin/case',
    method: 'put',
    data
  })
}

// 修改架层
export function editCase(data) {
  return request({
    url: '/virlib-admin/case',
    method: 'post',
    data
  })
}

// 删除架层
export function deleteCase(caseId) {
  return request({
    url: `/virlib-admin/case/${caseId}`,
    method: 'delete'
  })
}

export function getcaseArr(name, posId) {
  let params = '?'
  if (posId) {
    params += `posId=${posId}`
  }
  if (name) {
    params += `&&name=${name}`
  }
  return request({
    url: `/virlib-admin/case/list${params}`,
    method: 'get'
  })
}
